********************************************************************************
* 						 CHEMICAL WEAPONS ANALYSIS							   *
********************************************************************************

clear all
set more off
set scheme plotplainblind
macro drop _all
est drop _all
set matsize 800
set seed 8675309

** Set Working Directory

if c(username) == "christopherblair"{
global dir "~/Desktop/JOP Replication"
global raw "${dir}/Raw Files"
global code "${dir}/Code"
global result "${dir}/Results"										
}

else if c(username) == "youruser"{
global dir "~/Desktop/JOP Replication"
global raw "${dir}/Raw Files"
global code "${dir}/Code"
global result "${dir}/Results"	
}

cd "$raw"

********************************************************************************

use "${dir}/ams175.dta", clear

sort ballotnum

global demographic "rankgrade age school monthsoversea"
global covariates "ally_relations orientation_officers infocenter orient_meet war_interest honolulu_contact"

********************************************************************************
*							HETEROGENEOUS EFFECTS							   *
********************************************************************************

eststo clear

reg use c.numchamber##c.lowedu c.nummask##c.lowedu ally_relations orientation_officers infocenter orient_meet war_interest honolulu_contact 0.school i.(age rankgrade monthsoversea base), cluster(base)
eststo: margins, dydx(numchamber) at(lowedu=(0(1)4)) atmeans vsquish post
coefplot (est1, msym(O) mfcolor(white) mlcolor(black) msize(large) ciopts(lwidth(.6 1.15) lcolor(black))), vert ci(95 90) ylabel(-.1(.02).06) ymtick(-.1(.01).06) legend(off) ytitle("AME of Gas Chamber Exposure on Support" "for Using Chemical Weapons Against Japan") title(" ") xlabel(1 "College" 2 "High School" 3 "Some High School" 4 "8th Grade" 5 "<8th Grade", angle(45)) yline(0, lcolor(cranberry) lpatt(shortdash)) yline(-.1, lcolor(gs10) lpatt(dot))  yline(.06, lcolor(gs10) lpatt(dot)) title("Educational Attainment") saving("${result}/chamber_edu.gph", replace)
graph export "${result}/chamber_edu.png", replace

eststo clear

gen reverse=information_center*-1

reg use c.numchamber##c.reverse c.nummask##c.reverse ally_relations orientation_officers infocenter orient_meet war_interest honolulu_contact i.(age rankgrade monthsoversea base), cluster(base)
eststo: margins, dydx(numchamber) at(reverse=(-1.348781 .2618844  1.086703)) atmeans vsquish post
coefplot (est1, msym(O) mfcolor(white) mlcolor(black) msize(large) ciopts(lwidth(.6 1.15) lcolor(black))), vert ci(95 90) ylabel(-.1(.02).06) ymtick(-.1(.01).06) legend(off) ytitle("AME of Gas Chamber Exposure on Support" "for Using Chemical Weapons Against Japan") title(" ") xlabel(1 "25th Percentile" 2 "50th Percentile" 3 "75th Percentile", angle(45)) yline(0, lcolor(cranberry) lpatt(shortdash)) yline(-.1, lcolor(gs10) lpatt(dot)) yline(.06, lcolor(gs10) lpatt(dot)) title("Low Information Access") saving("${result}/chamber_info.gph", replace)
graph export "${result}/chamber_info.png", replace

eststo clear

replace reverse=general_interest*-1

reg use c.numchamber##c.reverse c.nummask##c.reverse ally_relations orientation_officers infocenter orient_meet war_interest honolulu_contact i.(age rankgrade monthsoversea base), cluster(base)
eststo: margins, dydx(numchamber) at(reverse=(-.8912646 -.3420756 .5774525)) atmeans vsquish post
coefplot (est1, msym(O) mfcolor(white) mlcolor(black) msize(large) ciopts(lwidth(.6 1.15) lcolor(black))), vert ci(95 90) ylabel(-.1(.02).06) ymtick(-.1(.01).06) legend(off) ytitle("AME of Gas Chamber Exposure on Support" "for Using Chemical Weapons Against Japan") title(" ") xlabel(1 "25th Percentile" 2 "50th Percentile" 3 "75th Percentile", angle(45)) yline(0, lcolor(cranberry) lpatt(shortdash)) yline(-.1, lcolor(gs10) lpatt(dot)) yline(.06, lcolor(gs10) lpatt(dot)) title("Low News Interest") saving("${result}/chamber_news.gph", replace)
graph export "${result}/chamber_news.png", replace

eststo clear

graph combine "${result}/chamber_edu.gph" "${result}/chamber_info.gph" "${result}/chamber_news.gph", cols(3)
graph export "${result}/chamber_hetero.png", replace

********************************************************************************

clear
